package nju.jun.reader.tieba.model;

public class TiebaNovel {

	private String tiebaName;
	
	private String novelName;
	
	private boolean onTop;
	
	private int volume; // current max volume number
	
	private int chapter; // current max chapter number in volume
	
	private String author;
	
	public TiebaNovel() {
		
	}
	
//	public TiebaNovel(String tiebaName, String novelName, boolean onTop, int chapter, String author) {
//		this.tiebaName = tiebaName;
//		this.novelName = novelName;
//		this.onTop = onTop;
//		this.chapter = chapter;
//		this.author = author;
//	}
	
	public String getTiebaName() {
		return tiebaName;
	}

	public void setTiebaName(String tiebaName) {
		this.tiebaName = tiebaName;
	}

	public String getNovelName() {
		return novelName;
	}

	public void setNovelName(String novelName) {
		this.novelName = novelName;
	}

	public boolean isOnTop() {
		return onTop;
	}

	public void setOnTop(boolean onTop) {
		this.onTop = onTop;
	}
	
	public int getVolume() {
		return volume;
	}

	public void setVolume(int volume) {
		this.volume = volume;
	}

	public int getChapter() {
		return chapter;
	}

	public void setChapter(int chapter) {
		this.chapter = chapter;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getStorageDirectory() {
		return "storage/" + author + "/" + novelName;
	}

	/**
	 * Equals if same author and novel name.
	 * 
	 * @param another
	 * @return
	 */
	public boolean equals(TiebaNovel another) {
		if (another == null) {
			return false;
		}
		if (!this.novelName.equals(another.novelName)) {
			return false;
		}
		if (!this.author.equals(another.author)) {
			return false;
		}
		return true;
	}
	
	
}
